using LuaInterface;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Windows.Forms;

namespace RxjhServer
{
	public class ScriptClass
	{
		public LuaFunction 怪物死亡事件;

		public LuaFunction 打开物品事件;

		public LuaFunction 物品兑换事件;

		public Dictionary<int, LuaFunction> 任务事件列表 = new Dictionary<int, LuaFunction>();

		public Dictionary<int, LuaFunction> 打开物品事件列表 = new Dictionary<int, LuaFunction>();

		public Dictionary<int, LuaFunction> 怪物死亡事件列表 = new Dictionary<int, LuaFunction>();

		public Dictionary<int, LuaFunction> 物品兑换事件列表 = new Dictionary<int, LuaFunction>();

		public string 脚本目录 = "script";

		public Lua pLuaVM;

		public ScriptClass()
		{
			注册脚本API();
			脚本目录 = Application.StartupPath + "\\Script";
			GetUrlDirectory(脚本目录);
			Form1.WriteLine(3, "加载脚本完成");
			注册事件();
		}

		public void 注册事件()
		{
			打开物品事件 = pLuaVM.GetFunction("OpenItmeTrigGer");
			怪物死亡事件 = pLuaVM.GetFunction("DestroyMonster");
			物品兑换事件 = pLuaVM.GetFunction("ExchangeItem");
		}

		public void SetUrlFile(string Url)
		{
			string extension = Path.GetExtension(Url);
			if (extension == ".lua")
			{
				try
				{
					pLuaVM.DoFile(Url);
				}
				catch (Exception ex)
				{
					Console.WriteLine(ex.Message);
					Form1.WriteLine(1, "加载Lua脚本出错" + ex.Message);
				}
			}
		}

		public void GetUrlDirectory(string url)
		{
			if (Directory.Exists(url))
			{
				string[] files = Directory.GetFiles(url);
				string[] array = files;
				string[] array2 = array;
				string[] array3 = array2;
				string[] array4 = array3;
				string[] array5 = array4;
				string[] array6 = array5;
				string[] array7 = array6;
				string[] array8 = array7;
				string[] array9 = array8;
				foreach (string urlFile in array9)
				{
					try
					{
						SetUrlFile(urlFile);
					}
					catch (Exception value)
					{
						Console.Write(value);
					}
				}
				GetUrlDirectoryS(url);
			}
		}

		public void GetUrlDirectoryS(string url)
		{
			string[] directories = Directory.GetDirectories(url);
			string[] array = directories;
			string[] array2 = array;
			string[] array3 = array2;
			string[] array4 = array3;
			string[] array5 = array4;
			string[] array6 = array5;
			string[] array7 = array6;
			string[] array8 = array7;
			string[] array9 = array8;
			foreach (string url2 in array9)
			{
				GetUrlDirectory(url2);
			}
		}

		public void 注册脚本API()
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Expected O, but got Unknown
			try
			{
				pLuaVM = (Lua)(object)new Lua();
				pLuaVM.RegisterFunction("SendMissionMsg", (object)this, (MethodBase)GetType().GetMethod("任务提示数据发送"));
				pLuaVM.RegisterFunction("SendSysMsg", (object)this, (MethodBase)GetType().GetMethod("系统提示"));
				pLuaVM.RegisterFunction("SendKongfuMsg", (object)this, (MethodBase)GetType().GetMethod("学习技能提示"));
				pLuaVM.RegisterFunction("SendNoticeMsg", (object)this, (MethodBase)GetType().GetMethod("发送公告"));
				pLuaVM.RegisterFunction("AddQuest", (object)this, (MethodBase)GetType().GetMethod("设置任务数据"));
				pLuaVM.RegisterFunction("AddMission", (object)this, (MethodBase)GetType().GetMethod("设置任务数据"));
				pLuaVM.RegisterFunction("AddQigong", (object)this, (MethodBase)GetType().GetMethod("新学气功"));
				pLuaVM.RegisterFunction("AddSkill", (object)this, (MethodBase)GetType().GetMethod("学习技能"));
				pLuaVM.RegisterFunction("AddSkillBook6", (object)this, (MethodBase)GetType().GetMethod("发送六转技能书"));
				pLuaVM.RegisterFunction("AddSkillBook7", (object)this, (MethodBase)GetType().GetMethod("发送七转技能书"));
				pLuaVM.RegisterFunction("AddSkillBook8", (object)this, (MethodBase)GetType().GetMethod("发送八转技能书"));
				pLuaVM.RegisterFunction("AddItme", (object)this, (MethodBase)GetType().GetMethod("增加物品Script"));
				pLuaVM.RegisterFunction("AddItmeProp", (object)this, (MethodBase)GetType().GetMethod("增加物品带属性"));
				pLuaVM.RegisterFunction("DelItme", (object)this, (MethodBase)GetType().GetMethod("删除物品"));
				pLuaVM.RegisterFunction("AddQuestItme", (object)this, (MethodBase)GetType().GetMethod("增加任务物品"));
				pLuaVM.RegisterFunction("AddTaoZhuang", (object)this, (MethodBase)GetType().GetMethod("增加套装Script"));
				pLuaVM.RegisterFunction("GetWorldItme", (object)this, (MethodBase)GetType().GetMethod("GetWorldItme"));
				pLuaVM.RegisterFunction("GetPlayer", (object)this, (MethodBase)GetType().GetMethod("GetPlayerThis"));
				pLuaVM.RegisterFunction("GetQuestLevel", (object)this, (MethodBase)GetType().GetMethod("Get任务阶段"));
				pLuaVM.RegisterFunction("GetPackage", (object)this, (MethodBase)GetType().GetMethod("得到包裹空位位置"));
				pLuaVM.RegisterFunction("GetPackages", (object)this, (MethodBase)GetType().GetMethod("得到包裹空位位置组"));
				pLuaVM.RegisterFunction("GetPakItme", (object)this, (MethodBase)GetType().GetMethod("得到包裹物品"));
				pLuaVM.RegisterFunction("GetQuestItme", (object)this, (MethodBase)GetType().GetMethod("得到任务物品"));
				pLuaVM.RegisterFunction("SetPlayerTransfer", (object)this, (MethodBase)GetType().GetMethod("人物转职业"));
				pLuaVM.RegisterFunction("SetQigong", (object)this, (MethodBase)GetType().GetMethod("新学气功"));
				pLuaVM.RegisterFunction("SetPlayerLevel", (object)this, (MethodBase)GetType().GetMethod("设置玩家等级"));
				pLuaVM.RegisterFunction("SetPlayerVIP", (object)this, (MethodBase)GetType().GetMethod("设置人物会员"));
				pLuaVM.RegisterFunction("SetPlayerQCVIP", (object)this, (MethodBase)GetType().GetMethod("设置人物七彩会员"));
				pLuaVM.RegisterFunction("SetPlayerRxpiont", (object)this, (MethodBase)GetType().GetMethod("设置人物元宝"));
				pLuaVM.RegisterFunction("SetPlayerRxpiontx", (object)this, (MethodBase)GetType().GetMethod("设置人物积分"));
				pLuaVM.RegisterFunction("SetPlayerExp", (object)this, (MethodBase)GetType().GetMethod("设置人物经验值"));
				pLuaVM.RegisterFunction("SetPlayerJL", (object)this, (MethodBase)GetType().GetMethod("设置冲级奖励"));
				pLuaVM.RegisterFunction("ReSetPlayerLock", (object)this, (MethodBase)GetType().GetMethod("ReSetPlayerLevelLock"));
				pLuaVM.RegisterFunction("SetPlayerShuxing", (object)this, (MethodBase)GetType().GetMethod("设置人物属性"));
				pLuaVM.RegisterFunction("SetPlayerVipdj", (object)this, (MethodBase)GetType().GetMethod("设置会员等级"));
				pLuaVM.RegisterFunction("SetPlayerSE", (object)this, (MethodBase)GetType().GetMethod("设置玩家善恶"));
				pLuaVM.RegisterFunction("UpGongFu", (object)this, (MethodBase)GetType().GetMethod("更新武功和状态"));
				pLuaVM.RegisterFunction("UpJsjbsj", (object)this, (MethodBase)GetType().GetMethod("计算人物基本数据"));
				pLuaVM.RegisterFunction("UpHpMpSp", (object)this, (MethodBase)GetType().GetMethod("更新_HP_MP_HP"));
				pLuaVM.RegisterFunction("UpMoney", (object)this, (MethodBase)GetType().GetMethod("更新金钱和负重"));
				pLuaVM.RegisterFunction("UpExp", (object)this, (MethodBase)GetType().GetMethod("更新经验和历练"));
				pLuaVM.RegisterFunction("UpYzbItme", (object)this, (MethodBase)GetType().GetMethod("初始话已装备物品"));
				pLuaVM.RegisterFunction("UpUseItme", (object)this, (MethodBase)GetType().GetMethod("物品使用"));
				pLuaVM.RegisterFunction("GetPakItemNum", (object)this, (MethodBase)GetType().GetMethod("得到包裹物品数量"));
				pLuaVM.RegisterFunction("GetRxpiont", (object)this, (MethodBase)GetType().GetMethod("得到元宝数据"));
				pLuaVM.RegisterFunction("GetRxpiontx", (object)this, (MethodBase)GetType().GetMethod("得到积分数据"));
				pLuaVM.RegisterFunction("GetSTdata", (object)this, (MethodBase)GetType().GetMethod("判断师徒条件"));
				pLuaVM.RegisterFunction("UpSTdata", (object)this, (MethodBase)GetType().GetMethod("更新师徒数据"));
				pLuaVM.RegisterFunction("TEstMsg", (object)this, (MethodBase)GetType().GetMethod("TEstMsg"));
			}
			catch (Exception ex)
			{
				Form1.WriteLine(1, "注册脚本API出错-" + ex.Message);
			}
		}

		public void TEstMsg(object aa)
		{
			Console.WriteLine(aa);
		}

		public long 得到元宝数据(int UserWorldId)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.查百宝阁元宝数();
				return value.FLD_RXPIONT;
			}
			return 0L;
		}

		public long 得到积分数据(int UserWorldId)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.查百宝阁元宝数();
				return value.FLD_RXPIONTX;
			}
			return 0L;
		}

		public int 得到包裹物品数量(int UserWorldId, int 物品ID, int 数量)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				for (int i = 0; i < 36; i++)
				{
					if (BitConverter.ToInt32(value.装备栏包裹[i].物品ID, 0) == 物品ID && BitConverter.ToInt32(value.装备栏包裹[i].物品数量, 0) >= 数量)
					{
						return i;
					}
				}
			}
			return -1;
		}

		public bool 增加套装Script(int UserWorldId, int 套装类别, int 套装等级)
		{
			if (!World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				return false;
			}
			value.增加套装(套装类别, value.Player_Sex, value.Player_Job, value.Player_Zx, 套装等级);
			return true;
		}

		public void 设置冲级奖励(int UserWorldId, int 奖励)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.Player_jllevel = 奖励;
				value.保存人物的数据();
			}
		}

		public void ReSetPlayerLevelLock(int UserWorldId)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.重置锁定状态();
			}
		}

		public int 判断师徒条件(int UserWorldId, int 师徒等级, int 人物等级)
		{
			Players value;
			return (!World.allConnectedChars.TryGetValue(UserWorldId, out value) || value.Player_Level < 人物等级 || value.师傅数据.STLEVEL != 师徒等级 || value.师傅数据.STYHD < 16) ? (-1) : 0;
		}

		public void 更新师徒数据(int UserWorldId, int 师徒等级)
		{
			if (!World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				return;
			}
			value.师傅数据.STYHD = 0;
			value.师傅数据.STLEVEL = 师徒等级;
			value.徒弟更新师徒系统();
			Players players = World.检查玩家name(value.师傅数据.STNAME);
			if (players == null)
			{
				return;
			}
			int num = 0;
			while (true)
			{
				if (num < 3)
				{
					if (players.徒弟数据[num].TID == value.师傅数据.TID)
					{
						break;
					}
					num++;
					continue;
				}
				return;
			}
			players.徒弟数据[num].STYHD = 0;
			players.徒弟数据[num].STLEVEL = 4;
			players.师傅更新师徒系统(num);
		}

		public void 设置人物经验值(int UserWorldId, int 经验)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.人物经验 += 经验;
				value.计算人物基本数据3();
				value.更新经验和历练();
			}
		}

		public void 学习技能提示(int UserWorldId)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.学习技能提示();
			}
		}

		public void 设置人物元宝(int UserWorldId, long 元宝数, int 操作类型)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.百宝阁检察元宝数据((int)元宝数, 操作类型);
				value.保存元宝数据();
			}
		}

		public void 设置人物积分(int UserWorldId, long 元宝数, int 操作类型)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.百宝阁检察积分数据((int)元宝数, 操作类型);
				value.保存元宝数据();
			}
		}

		public void 设置人物属性(int UserWorldId, long 攻击, long 防御, long 生命)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				string[] array = World.升级会员需要属性.Split(',');
				if (value.FLD_VIP_攻击 < long.Parse(array[0]))
				{
					value.FLD_VIP_攻击 += (int)攻击;
				}
				if (value.FLD_VIP_防御 < long.Parse(array[1]))
				{
					value.FLD_VIP_防御 += (int)防御;
				}
				value.人物_VIP_HP += (int)生命;
				value.更新武功和状态();
				value.更新HP_MP_SP();
			}
		}

		public void 设置会员等级(int UserWorldId, long 等级)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value) && value.会员等级 < World.会员最高等级)
			{
				if (value.会员等级 + 等级 > World.会员最高等级)
				{
					value.会员等级 = World.会员最高等级;
				}
				else
				{
					value.会员等级 += 等级;
				}
				value.保存人物的数据();
			}
		}

		public void 设置玩家善恶(int UserWorldId, int 善恶)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.人物善恶 += 善恶;
			}
		}

		public void 设置人物七彩会员(int UserWorldId, int 会员时间)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				if (value.FLD_QCVIP == 0)
				{
					DateTime now = DateTime.Now;
					now = DateTime.Now.AddDays(会员时间);
					value.FLD_QCVIP = 1;
					value.FLD_QCVIPTIM = now;
					value.系统提示("恭喜您获得" + 会员时间.ToString() + "天七彩VIP！", 9, "系统提示");
					value.系统提示("你的七彩VIP到期时间是:" + value.FLD_QCVIPTIM.ToString("yyyy年MM月dd日 hh时mm分"), 9, "系统提示");
				}
				else
				{
					DateTime now2 = DateTime.Now;
					DateTime dateTime2 = value.FLD_QCVIPTIM = DateTime.Now.AddDays(会员时间);
					DateTime dateTime3 = dateTime2;
					DateTime dateTime4 = dateTime3;
					DateTime dateTime5 = dateTime4;
					DateTime dateTime6 = dateTime5;
					DateTime dateTime7 = dateTime6;
					DateTime dateTime8 = dateTime7;
					DateTime dateTime9 = dateTime8;
					now2 = dateTime9;
					value.系统提示("续时成功,你的七彩VIP到期时间是:" + value.FLD_QCVIPTIM.ToString("yyyy年MM月dd日 hh时mm分"), 9, "系统提示");
				}
				value.保存七彩会员数据();
			}
		}

		public void 设置人物会员(int UserWorldId, int 会员时间)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				if (value.FLD_VIP == 0)
				{
					DateTime now = DateTime.Now;
					now = DateTime.Now.AddMonths(会员时间);
					value.FLD_VIP = 1;
					value.FLD_VIPTIM = now;
					value.系统提示("恭喜您获得1个月的VIP！", 9, "系统提示");
					value.系统提示("你的VIP到期时间是:" + value.FLD_VIPTIM.ToString("yyyy年MM月dd日 hh时mm分"), 9, "系统提示");
				}
				else
				{
					DateTime now2 = DateTime.Now;
					DateTime dateTime2 = value.FLD_VIPTIM = DateTime.Now.AddMonths(会员时间);
					DateTime dateTime3 = dateTime2;
					DateTime dateTime4 = dateTime3;
					DateTime dateTime5 = dateTime4;
					DateTime dateTime6 = dateTime5;
					DateTime dateTime7 = dateTime6;
					DateTime dateTime8 = dateTime7;
					DateTime dateTime9 = dateTime8;
					now2 = dateTime9;
					value.系统提示("续时成功,你的VIP到期时间是:" + value.FLD_VIPTIM.ToString("yyyy年MM月dd日 hh时mm分"), 9, "系统提示");
				}
				value.保存会员数据();
			}
		}

		public void 设置玩家等级(int UserWorldId, int 等级, int v)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.人物经验 = 0L;
				value.Player_Level = 等级;
				value.计算人物基本数据();
				value.更新HP_MP_SP();
				value.更新武功和状态();
				value.更新经验和历练();
				value.更新金钱和负重();
				value.更新气功();
			}
		}

		public void 物品使用(int UserWorldId, int 位置, int 数量)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.物品使用(1, 位置, 数量);
			}
		}

		public void 删除物品(int UserWorldId, int 位置, int 数量)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.减去物品(位置, 数量);
			}
		}

		public int 得到包裹物品(int UserWorldId, int 物品ID)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				for (int i = 0; i < 36; i++)
				{
					if (BitConverter.ToInt32(value.装备栏包裹[i].物品ID, 0) == 物品ID)
					{
						return i;
					}
				}
			}
			return -1;
		}

		public void 初始话已装备物品(int UserWorldId)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.初始话已装备物品();
			}
		}

		public void 更新经验和历练(int UserWorldId)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.更新经验和历练();
			}
		}

		public void 保存人物的数据(int UserWorldId)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.保存人物的数据();
			}
		}

		public void 更新金钱和负重(int UserWorldId)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.更新金钱和负重();
			}
		}

		public void 更新武功和状态(int UserWorldId)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.更新武功和状态();
			}
		}

		public void 计算人物基本数据(int UserWorldId)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.计算人物基本数据();
			}
		}

		public void 更新_HP_MP_HP(int UserWorldId)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.更新HP_MP_SP();
			}
		}

		public void 新学气功(int UserWorldId, int 气功位置)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.新学气功(气功位置);
			}
		}

		public void 人物转职业(int UserWorldId, int 人物正邪, int 转)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.人物转职业(人物正邪, 转);
			}
		}

		public int 得到包裹空位位置(int UserWorldId)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				return value.得到包裹空位位置();
			}
			return -1;
		}

		public List<int> 得到包裹空位位置组(int UserWorldId, int 数量)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				return value.得到包裹空位位置组(数量);
			}
			return new List<int>();
		}

		public int Get任务阶段(int UserWorldId, int 任务ID)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				return value.Get任务阶段(任务ID);
			}
			return 0;
		}

		public ItmeClass GetWorldItme(int 物品ID)
		{
			if (World.Itme.TryGetValue(物品ID, out ItmeClass value))
			{
				return value;
			}
			return null;
		}

		public Players GetPlayerThis(int UserWorldId)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				return value;
			}
			return null;
		}

		public void 增加物品Script(int UserWorldId, int 物品ID, int 空位, int 数量)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.增加物品Script(物品ID, 空位, 数量);
			}
		}

		public bool 得到任务物品(int UserWorldId, int 物品ID, int 数量)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				return value.得到任务物品(物品ID, 数量);
			}
			return false;
		}

		public void 增加任务物品(int UserWorldId, int 物品ID, int 数量)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.设置任务物品(物品ID, 数量);
			}
		}

		public void 增加物品带属性(int UserWorldId, int 物品ID, int 位置, int 数量, int 物品属性0, int 物品属性1, int 物品属性2, int 物品属性3, int 物品属性4, int 绑定)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.增加物品带属性(物品ID, 位置, 数量, 物品属性0, 物品属性1, 物品属性2, 物品属性3, 物品属性4, 绑定);
			}
		}

		public void 任务提示数据发送(int UserWorldId, int 任务ID, int 操作ID, int 任务阶段ID)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.任务提示数据发送(任务ID, 操作ID, 任务阶段ID);
			}
		}

		public void 系统提示(int UserWorldId, string msg, int msgType, string name)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				string msg2 = string.Format(msg, value.UserName);
				value.系统提示(msg2, msgType, name);
			}
		}

		public void 设置任务数据(int UserWorldId, int 任务ID, int 任务阶段ID)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.设置任务数据(任务ID, 任务阶段ID);
			}
		}

		public void 学习技能(int UserWorldId, int FLD_武功类型, int FLD_INDEX)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.学习技能(FLD_武功类型, FLD_INDEX);
			}
		}

		public void 发送六转技能书(int UserWorldId, int 空位)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.发送六转技能书(空位);
			}
		}

		public void 发送七转技能书(int UserWorldId, int 空位)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.发送七转技能书(空位);
			}
		}

		public void 发送八转技能书(int UserWorldId, int 空位)
		{
			if (World.allConnectedChars.TryGetValue(UserWorldId, out Players value))
			{
				value.发送八转技能书(空位);
			}
		}

		public void 发送公告(string txt, int ggid)
		{
			try
			{
				foreach (Players value in World.allConnectedChars.Values)
				{
					if (value != null)
					{
						string msg = string.Format(txt, value.UserName);
						switch (ggid)
						{
						case 0:
							value.系统公告(msg);
							break;
						case 1:
							value.系统滚动公告(msg);
							break;
						case 2:
							value.系统提示(msg, 10, "系统信息");
							break;
						}
					}
				}
			}
			catch (Exception ex)
			{
				Form1.WriteLine(1, "发送公告出错：" + ex.Message);
			}
		}
	}
}
